<!doctype html>
<html lang="zh">
  <head>
    <meta charset="utf-8">
    <title>编辑图书</title>
  </head>
  <body>
    <h1>编辑图书</h1>
    {% if 'username' in session %}
      <p>当前用户: {{ session['username'] }} <a href="{{ url_for('logout') }}">退出</a></p>
      
    {% else %}
      <a href="{{ url_for('login') }}">登录</a>
      <a href="{{ url_for('register') }}">注册</a>
    {% endif %}
    <form method="post" enctype="multipart/form-data">
      <label for="title">书名:</label>
      <input type="text" name="title" id="title" value="{{ book[1] }}">
      <br>
      <label for="author">作者:</label>
      <input type="text" name="author" id="author" value="{{ book[2] }}">
      <br>
      <label for="description">描述:</label>
      <textarea name="description" id="description">{{ book[3] }}</textarea>
      <br>
      <label for="file">图书封面:</label>
      <input type="file" name="file" id="file">
      <br>
      <input type="submit" value="保存">
    </form>
  </body>
</html>